﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using QLT_Public;

namespace QLT_Data
{
   public class NhatKy_Data
    {
       KetNoiCSDL_Data kn = new KetNoiCSDL_Data();
       public DataTable LayDuLieu()
       {
           return kn.LayDuLieu("Load_tbl_NhatKy");

       }
       public DataTable taobang(string sql)
       {
           return kn.taoBang(sql);
       }
       public int Delete_NhatKyALL()
       {
           return kn.update("Delete_NhatKy_All");
       }
       public int Insert_NhatKy(NhatKy_Public taiKhoan,NhatKy_Public ngayGio,NhatKy_Public doiTuong,NhatKy_Public hanhDong,NhatKy_Public moTa)
       {
            int n=5;
           string[]name=new string[n];
           object[]value=new object[n];
           name[0]="@TaiKhoan";
           value[0]=taiKhoan.TaiKhoan;
           name[1]="@NgayGio";
           value[1]=ngayGio.NgayGio;
           name[2]="@DoiTuong";
           value[2]=doiTuong.DoiTuong;
           name[3]="@HanhDong";
           value[3]=hanhDong.HanhDong;
           name[4]="@MoTa";
           value[4]=moTa.MoTa;
           return kn.update("Insert_NhatKy",name,value,n);
       }
       public int Delete_NhatKy(NhatKy_Public ma)
       {
           int n=1;
           string[]name=new string[n];
           object[]value=new object[n];
           name[0]="@MaNhatKy";
           value[0]=ma.MaNhatKy;
           return kn.update("Delete_NhatKy",name,value,n);
       }
   }
    
}
